<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8 no-js">
    <![endif]-->
    <!--[if IE 9]>
    <html lang="en" class="ie9 no-js">
        <![endif]-->
        <!--[if !IE]>
        <!-->
        <!--<![endif]-->
        <!-- BEGIN HEAD -->
        <!-- BEGIN BODY -->
<body class="page-header-fixed">
        <!-- BEGIN PAGE CONTENT-->
        <div class="site_content">
            <div class="realtime_content content_box no_table_filter">
                <div>
                    <form  id="formid" method="post" class="instruct_box w5c-form demo-form" id="form_id" method="post"  role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
                        <hr />
                        <div style="width: 400px">
                            <div class="form-group form1">
                                <label>设备地址</label>
                                <input type="text" class="form-control" required="" ng-model="chargerId" id="chargerId" name="chargerId" placeholder="请输入16位chargerId"></div>
                            <div class="form-group form1">
                                <label>版本号</label>
                                <select class="form-control"
                                                   id="protocol_version" name="protocol_version">
                                    <option value="0101">0101</option>
                                    <option value="0102">0102</option>
                                    <option value="0103" selected="">0103</option>
                                </select>
                            </div>
                        </div>
                        <div class="modal-footer t_l" style="width: 400px;text-align: right">
                            <button style="margin-bottom: 0" type="reset" class="btn btn-warning" data-dismiss="modal"> <i class="fa fa-refresh"></i>
                                重置
                            </button>
                            <button type="button" class="btn btn-primary" w5c-form-submit="data_btn()"> <i class="fa fa-search"></i>
                                重启
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- END PAGE CONTENT-->
</body>
<script>
function data_btn(){
        $('button.btn-primary').on('click', function() {
        $.ajax({
            type : 'post',
            url : '../chargeControll/restartCharger',
            data : $('#form_id').serialize(),
            dataType : "json",
            async : false,
            success : function(data) {
                if (data.code == '200') {
                    bootboxWindow.alert("指令下发成功!", null);
                } else {
                    bootboxWindow.alert("指令下发失败!", null);
                }
            },
            error:function(){
                bootboxWindow.alert("连接服务器失败",null);
            }
        })
    });
}
</script>
    </html>